home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / text / hyper / hsc_source.lha / hsc / source / ugly / Makefile < prev    next >
Makefile  |  1996-11-15  |  7KB  |  274 lines

  1. #
  2. # Makefile for ugly functions
  3. #
  4. # Copyright (C) 1993,94,95,96  Thomas Aglassinger
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. #--------------------------------------------------------------------
  20.  
  21. #
  22. # This Makefile works fine with GNU make 3.74
  23. #
  24. # But as it doesn't require any special features besides from
  25. # conditionals (ifdef/ifeq/else/endif), it should also work with 
  26. # other versions of `make'.
  27. #
  28.  
  29. #--------------------------------------------------------------------
  30. # Selection of compiler and environment
  31. #
  32. # if you specify none, a cc-like compiler and a posix-compatible
  33. # environment will be asumed
  34. #
  35.  
  36. #AMIGA_GCC    = 1    # amiga & gcc
  37. AMIGA_SASC    = 1    # amiga & sas/c 6.x
  38. #AMIGA_VBCC     = 1    # amiga & vbcc (experimental)
  39. #POSIX_GCC    = 1    # posix & gcc
  40.  
  41. #--------------------------------------------------------------------
  42. # Selection of compiler mode
  43. #
  44. # if you specify none, an unoptimised version without
  45. # debugging stuff will be created
  46. #
  47.  
  48. #COMPILER_MODE    = opt    # create optimised version
  49. COMPILER_MODE    = dbg    # create debugging version
  50.  
  51. #--------------------------------------------------------------------
  52. # usually, there should be no need to change anything below this line
  53. #--------------------------------------------------------------------
  54.  
  55. #
  56. # description of symbols:
  57. #
  58. # - COMP    compiler call to create an object file (*.o)
  59. # - LINK    compiler call to link a file
  60. # - SYS        defines operating system
  61. #        (supported: AMIGA,UNIX)
  62. # - DEBUG    compiler flags for developer version
  63. # - NORM    compiler flags for non-optimised version
  64. # - OPTIM    compiler flags for optimised version
  65.  
  66. ifdef AMIGA_GCC
  67. #
  68. # gcc AMIGA
  69. #
  70. SYS  = -DAMIGA -Damigados -noixemul
  71. DEBUG= $(SYS) -DDEBUG_UGLY -ggdb -m68000
  72. NORM = $(SYS) 
  73. OPTIM= $(SYS) -O -s
  74. COMP = gcc -Wall -W -ansi -c
  75. LINK = gcc -Wall -W -ansi -o $@
  76.  
  77. else
  78. ifdef POSIX_GCC
  79. #
  80. # gcc UNIX
  81. #
  82. SYS  = -DUNIX
  83. DEBUG= $(SYS) -DDEBUG_UGLY -ggdb
  84. NORM = $(SYS) 
  85. OPTIM= $(SYS) -O -s
  86. COMP = gcc -Wall -W -ansi -c
  87. LINK = gcc -Wall -W -ansi -o $@
  88.  
  89. else
  90. ifdef AMIGA_SASC
  91. #
  92. # sas/c AMIGA
  93. #
  94. SYS  =
  95. opts =  
  96. DEBUG= $(SYS) $(opts) DEBUG=SF DEF=DEBUG_UGLY
  97. NORM = $(SYS) $(opts) DEBUG=LINE
  98. OPTIM= $(SYS) $(opts) IGN=304 IGN=93 OPTIMIZE NOSTKCHK 
  99. LINK = sc LINK 
  100. COMP = sc
  101.  
  102. else
  103. ifdef AMIGA_VBCC
  104. #
  105. # vbcc AMIGA
  106. #
  107. SYS  = -DAMIGA -dontwarn=205
  108. DEBUG= -DDEBUG
  109. NORM = 
  110. OPTIM=
  111. COMP = vc $(SYS) -o $@ -c
  112. LINK = vc $(SYS) -o $@ 
  113.  
  114. else
  115. #
  116. # cc (should work on most Unix-esh systems;
  117. #    but no optimisation is performed)
  118. #
  119. SYS  = -DUNIX
  120. DEBUG= -DDEBUG_UGLY
  121. NORM = 
  122. OPTIM=
  123. COMP = cc $(SYS) -o $@ -c
  124. LINK = cc $(SYS) -o $@
  125.  
  126. endif    # AMIGA_VBCC
  127. endif    # AMIGA_SASC
  128. endif    # POSIX_GCC
  129. endif    # AMIGA_GCC
  130.  
  131. #
  132. # compiler mode 
  133. #
  134. ifeq ($(strip $(COMPILER_MODE)),opt)
  135. mode = $(OPTIM)
  136. else
  137. ifeq ($(strip $(COMPILER_MODE)),dbg)
  138. mode = $(DEBUG)
  139. else
  140. mode = $(NORM)
  141. endif
  142. endif
  143.  
  144. #--------------------------------------
  145.  
  146. #
  147. # implicit rule for object-file
  148. #
  149. %.o : %.c
  150.     $(COMP) $*.c $(CMODE)
  151.  
  152. #
  153. # test files
  154. #
  155. all : test_es test_fn test_args test_file test_list test_mem test_str test_time
  156.  
  157. clean :
  158.     delete (#?.o|#?.s|#?.p) quiet
  159.  
  160. depend :
  161.     MkDepend #?.c -i/ -v
  162.  
  163.  
  164. ##
  165. ## project
  166. ##
  167.  
  168. #ugly.o: uargs.o bntree.o dllist.o memory.o prginfo.o ustring.o umx.o fname.o infile.o ugly.c
  169. #        $(COMP)  ugly.c
  170.  
  171. #ugly_dbg.o: uargs.o bntree.o dllist.o memory.o prginfo.o ustring.o umx.o fname.o infile.o ugly.c
  172. #        $(COMP)  ugly.c -DUMEM_TRACKING_DEF -o ugly_dbg.o
  173.  
  174. #header: #?.h
  175. #        copy #?.h sc:include/ugly
  176.  
  177. all_ugly.o :
  178.     $(COMP) all_ugly.c $(mode)
  179.  
  180. ##
  181. ## test files
  182. ##
  183.  
  184. test_fn : test_fn.c fname.o umemory.o expstr.o
  185.     $(LINK) $(mode) test_fn.c expstr.o fname.o ustring.o umemory.o
  186.  
  187. test_args : test_args.c uargs.o dllist.o prginfo.o umemory.o ustring.o
  188.     $(LINK) $(mode) test_args.c uargs.o ustring.o dllist.o umemory.o prginfo.o
  189.  
  190. test_es : test_es.c expstr.o umemory.o ustring.o
  191.     $(LINK) $(mode) test_es.c expstr.o ustring.o umemory.o
  192.  
  193. test_file : test_file.c infile.o dllist.o expstr.o umemory.o
  194.     $(LINK) $(mode) test_file.c dllist.o expstr.o infile.o ustring.o umemory.o
  195.  
  196. test_list : test_list.c dllist.o ustring.o umemory.o
  197.     $(LINK) $(mode) test_list.c dllist.o ustring.o umemory.o
  198.  
  199. test_mem : test_mem.c umemory.o dllist.o ustring.o
  200.     $(LINK) $(mode) test_mem.c dllist.o umemory.o ustring.o
  201.  
  202. #test_out : test_out.c outfile.o dllist.o expstr.o umemory.o
  203. #    $(LINK) $(mode) test_out.c dllist.o expstr.o outfile.o ustring.o umemory.o
  204.  
  205. test_str : test_str.c umemory.o ustring.o
  206.     $(LINK) $(mode) test_str.c umemory.o ustring.o
  207.  
  208. test_time.o : test_time.c utime.o umemory.o ustring.o expstr.o
  209.     $(COMP) test_time.c $(mode)
  210.  
  211. test_time : test_time.o 
  212.     $(LINK) $(mode) test_time.c umemory.o ustring.o expstr.o utime.o
  213.  
  214. # --- DO NOT MODIFY THIS LINE -- AUTO-DEPENDS FOLLOW ---
  215. all_ugly.o : /ugly/prginfo.c /ugly/infile.c /ugly/ustrlist.c /ugly/ufile.c \
  216.     /ugly/uargs.c /ugly/dllist.c /ugly/fname.c /ugly/expstr.c \
  217.     /ugly/ustring.c /ugly/umemory.c /ugly/udebug.h utypes.h umemory.h \
  218.     infile.h fname.h ustring.h expstr.h ustrlist.h ufile.h args_hlp.c \
  219.     args_prp.c args_set.c args_fre.c uargs.h dllist.h udebug.h
  220.  
  221. args_fre.o : uargs.h dllist.h ustring.h umemory.h utypes.h udebug.h
  222.  
  223. args_hlp.o : uargs.h dllist.h ustring.h umemory.h utypes.h udebug.h
  224.  
  225. args_prp.o : uargs.h dllist.h ustring.h umemory.h utypes.h udebug.h
  226.  
  227. args_set.o : uargs.h dllist.h ustring.h umemory.h utypes.h udebug.h
  228.  
  229. dllist.o : dllist.h umemory.h utypes.h udebug.h
  230.  
  231. expstr.o : expstr.h umemory.h ustring.h utypes.h udebug.h
  232.  
  233. fname.o : fname.h expstr.h ustring.h umemory.h utypes.h udebug.h
  234.  
  235. hello.o :
  236.  
  237. infile.o : umemory.h infile.h fname.h ustring.h expstr.h utypes.h dllist.h \
  238.     udebug.h
  239.  
  240. prginfo.o : utypes.h udebug.h
  241.  
  242. test_args.o : umemory.h prginfo.h dllist.h uargs.h utypes.h udebug.h
  243.  
  244. test_es.o : expstr.h ustring.h umemory.h utypes.h udebug.h
  245.  
  246. test_file.o : infile.h umemory.h utypes.h dllist.h expstr.h udebug.h
  247.  
  248. test_fn.o : fname.h expstr.h ustring.h utypes.h udebug.h
  249.  
  250. test_list.o : dllist.h ustring.h umemory.h utypes.h udebug.h
  251.  
  252. test_mem.o : ustring.h umemory.h utypes.h udebug.h
  253.  
  254. test_prg.o : prginfo.h utypes.h udebug.h
  255.  
  256. test_str.o : ustring.h umemory.h utypes.h udebug.h
  257.  
  258. test_time.o : utime.h expstr.h ustring.h umemory.h utypes.h udebug.h
  259.  
  260. uargs.o : args_hlp.c args_prp.c args_set.c args_fre.c uargs.h dllist.h \
  261.     ustring.h umemory.h utypes.h udebug.h
  262.  
  263. ufile.o : ufile.h expstr.h ustring.h umemory.h utypes.h udebug.h
  264.  
  265. umemory.o : umemory.h utypes.h udebug.h
  266.  
  267. ustring.o : ustring.h umemory.h utypes.h udebug.h
  268.  
  269. ustrlist.o : ustrlist.h dllist.h ustring.h utypes.h udebug.h
  270.  
  271. utime.o : utime.h expstr.h ustring.h umemory.h utypes.h udebug.h
  272.  
  273. # --- DO NOT MODIFY THIS LINE -- AUTO-DEPENDS PRECEDE ---
  274.